<?
@ session_start();
include_once("class.lib/db.class.php");
include_once("class.lib/user.class.php");
include_once("class.lib/captcha.class.php");
include_once("class.lib/universite.class.php");
include_once("class.lib/etablissement.class.php");
include_once("class.lib/grade.class.php");
include_once("class.lib/aa_type_candidature.class.php");
include_once("class.lib/aa_complement_infos.class.php");
if(isset($_SESSION["cin"]))$cin=$_SESSION["cin"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Soumission de Projet</title>
		<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="iso-8859-1" />
		<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="iso-8859-1" />
		<script src="js/jquery.js" type="text/javascript"></script>	
		<script src="js/jquery.validationEngine-fr.js" type="text/javascript"></script>  
		<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
		<script type="text/javascript" src="javascript.js"></script>
		
		
		

	</head>
	<body>
		<center><h3>FORMULAIRE DE CANDIDATURE</h3></center>
		<form id="formID" class="formular" method="post" action="inscription.php"><b>IDENTIFICATION DU PORTEUR DU PROJET</b>
		<fieldset>
				<legend>Param&ecirc;tres de votre compte</legend>
				<label>
					<span>Nom d'utilisateur : </span>
					<input class="validate[required,custom[noSpecialCaracters],length[0,20]]" type="text" name="login" id="login" />
				</label>
				<label>
					<span>Mot de passe : </span>
					<input class="validate[required,length[2,6]] text-input" type="password" name="password"  id="password" />
				</label>
				<label>
					<span>Confirmation de votre mot de passe : </span>
					<input class="validate[required,confirm[password]] text-input" type="password" name="password2"  id="password2" />
				</label>
			</fieldset>
		
		<fieldset>
		
		<?php 
		          $Type_Candidature = new Type_Candidature();
                  $u=$Type_Candidature->getAllType();
				 // var_dump($Type_Candidature);
		?>
		<legend>La candidature est pr&eacute;sent&eacute;e par</legend>
		<label> <span></span>
		<select name="code_type_cand" id="code_type_cand"  class="validate[required]" title="Choisir La candidature">
                <option value=""></option>
		<?php		    
				  // Liste des universités
                 while (list($clef,$valeur)=each($u)) 
				     {  $libelle = strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
					   
						echo "<OPTION value=".$valeur[0].">".$libelle."</OPTION>";
                     }
		  ?>
              </select>
		</label>	
		<em>
		N.B. La candidature d'un &eacute;tablissement doit &ecirc;tre pr&eacute;sent&eacute;e par le chef de l'&eacute;tablissement.  
		</em>	
		</fieldset>
		
		<fieldset>
				<legend>Porteur du projet  </legend>
				
				<label> 
					<span>Nom : </span>
					<input class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="firstname" id="firstname" />
				</label>
				<label>
					<span>Pr&eacute;nom : </span>
					<input class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="lastname" id="lastname" />
				</label>
				<label>
					<span>Grade :</span>
				<select name="grade" id="grade" maxlength="50"  class="validate[required]" >
					<option value="">Choisissez votre grade</option>
					<?php 
		          $grade = new Grade();
                  $g=$grade->getGrade();
				  // Liste des grades
                 while (list($clef,$valeur)=each($g)) 
				     {  if($valeur[0]<10) $valeur[0]="0".$valeur[0];
						echo "<OPTION value=".$valeur[0].">$valeur[2]</OPTION>";
                     }
		        ?>
				</select>
				
				</label>
				
				
				<label>
				<span>Sp&eacute;cialit&eacute; : </span>
					<input class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="specialite" id="specialite" />
				</label>
				
				<label>
					<span>Fonction : </span>
					<input class="text-input" type="text" name="fonction" id="fonction" />
				</label>
				
				

				
				  
             <label>
			 <span>Universit&eacute; :</span>
			<select name="universite" id="universite" maxlength="50" 
			OnChange="if (this.value=='') {} else if (this.value=='autre') {  document.getElementById('autre_universite').style.display =''; } else sendData('id=a'+this.value,'etablissement2.php','contenu')" onKeyUp="if (this.value=='') {} else if (this.value=='autre') {  document.getElementById('autre_universite').style.display =''; } else sendData('id=a'+this.value,'etablissement2.php','contenu')" class="validate[required]" title="Veuillez selectionner votre Universit&eacute; SVP!">
                <option value="">Choisir Universit&eacute;</option>
				<option value="autre">Autre</option>
			    <?php 
		          $univ = new Universite();
                  $u=$univ->getAllUniversite();
				  // Liste des universit�s
                 while (list($clef,$valeur)=each($u)) 
				     {  $libelle = strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
					    if($valeur[0]<10) $valeur[0]="0".$valeur[0];
						echo "<OPTION value=".$valeur[0].">".$libelle."</OPTION>";
                     }
		  ?>
              </select>
			 </label>
			 
			 	<label id="autre_universite"  style="display:none;">
					<span>Autre Universit&eacute; : </span>
					<input class="text-input" type="text" name="autreuniversite" id="autreuniversite" />
				</label>
			 
			 <label>
			  <span id="contenu" >
              <span>Etablissement :</span>
            <select name="etablissement" id="etablissement" maxlength="23" class="validate[required]" title="Veuillez selectionner votre Etablissement SVP!"
			
			 OnChange="if(this.value=='autre') {  document.getElementById('autre_etablissement').style.display =''; } " 
			 onKeyUp=" if(this.value=='autre')  {document.getElementById('autre_etablissement').style.display ='';} " 
				   
			>
               <option value="">Choisir Etablissement</option>
			   <option value="autre">Autre</option>
			</select> 
			</span>
			 </label>
			 
			 	<label id="autre_etablissement" style="display:none;">
					<span>Autre &Eacute;tablissement : </span>
					<input class="text-input" type="text" name="autreetablissement" id="autreetablissement" />
				</label>
			 
			 <em>
			 N.B. M&ecirc;me si la candidature est pr&eacute;sent&eacute;e par un &eacute;tablissement universitaire, un porteur du projet est n&eacute;cessaire. Il assurera le pilotage du projet et sera l'interlocuteur de l'UVT pour toutes les questions techniques et p&eacute;dagogiques concernant le projet. Il animera l'&eacute;quipe du projet.
			 </em>
			</fieldset>
            
		<fieldset>
				<legend>Coordonn&eacute;es du porteur du projet </legend>	
                <table>
                <tr>
                	<td>
                        <label>
                            <span>N&deg;CIN : </span>
                            <input class="validate[required,custom[onlyNumber],length[8,8]] text-input" type="text" size="8" maxlength="8" name="ncin"  id="ncin" />
                        </label>
					</td>
    			</tr>
                
                 <tr>
                	<td>
                    <label>
                    	<span>Email  : </span>
                        <input class="validate[required,custom[email]] text-input" type="text" name="email" id="email"  />
                    </label>
                	</td>
    			</tr>
                 <tr>
                	<td>
                        <label>
                            <span>Confirmation email : </span>
                            <input class="validate[required,confirm[email]] text-input" type="text" name="email2"  id="email2" />
                        </label>
					</td>
    			</tr>
				
                 <tr>
                	<td>
                        <label>
                            <span>Adresse : </span>
                            <textarea class="validate[required] text-input" type="text" name="AdressePostale" id="AdressePostale" ></textarea>
                        </label>
					</td>
                	<td>
                        <label>
                            <span>Ville : </span>
                            <input class="validate[required,custom[onlyLetter]] text-input" type="text" name="ville" id="ville" />
                        </label>
				
                        <label>
                            <span>Code Postale : </span>
                            <input class="validate[required,custom[onlyNumber],length[4,8]] text-input" type="text" name="CodePostale" id="CodePostale" />
                        </label>
					</td>
    			</tr>
				
                
                 <tr>
                	<td>
                        <label>
                            <span>GSM : </span>
                            <input class="validate[required,custom[telephone]] text-input" type="text" name="NumMobile"  id="NumMobile" />
                        </label>
					</td>
                	<td>
                        <label>
                            <span>T&eacute;l&eacute;phone fixe : </span>
                            <input class="text-input" type="text" name="NumTelephone"  id="NumTelephone" />
                        </label>
					</td>
    			</tr>
                
                 <tr>
                	<td>
                        <label>
                            <span>Fax : </span>
                            <input class="text-input" type="text" name="fax"  id="fax" />
                        </label>
                	</td>
    			</tr>
				</table>
				<!--div>
					<span>Radio Groupe : <br /></span>
					<span>radio 1: </span>
					<input class="validate[required] radio" type="radio"  name="radiogoupe"  id="radio1"  value="5" />
					<span>radio 2: </span>
					<input class="validate[required] radio" type="radio" name="radiogoupe"  id="radio2"  value="3" />
					<span>radio 3: </span>
					<input class="validate[required] radio" type="radio" name="radiogoupe"  id="radio3"  value="9" />
				</div>
				<div>
					<span>Max 2 checkbox : <br /></span>
				
					<input class="validate[minCheckbox[2]] checkbox" type="checkbox"  name="checkboxgroupe" id="maxcheck1" value="5" />
					
					<input class="validate[minCheckbox[2]] checkbox" type="checkbox" name="checkboxgroupe" id="maxcheck2"  value="3" />
				
					<input class="validate[minCheckbox[2]] checkbox" type="checkbox" name="checkboxgroupe" id="maxcheck3"  value="9" />
				</div-->
				<!--label>
					<span>Date : (format YYYY-MM-DD)</span>
					<input class="validate[required,custom[date]] text-input" type="text" name="date"  id="date" />
				</label-->
				

				
				
		</fieldset>
			
			
		<fieldset>
		
		<?php 
		          $Complement_Infos = new Complement_Infos();
                  $u=$Complement_Infos->getAllComplement();
				 // var_dump($Type_Candidature);
		?>
		<legend>Informations compl&eacute;mentaires</legend>
		<label> <span></span>
		<em>Le porteur du projet a-t-il une exp&eacute;rience ou a-t-il re&ccedil;u une formation dans l'un des domaines suivants ?</em>
		<br /><br />
		<table>
        	<tr>
            	<td></td>
                <td></td>
                <td>Oui</td>
                <td>Non</td>
            </tr>
		<?php		    
				  // Liste des universit�s
				  
                 while (list($clef,$valeur)=each($u)) 
				     {  
					    $libelle = $valeur[1];//strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
					   
						echo "
						<tr>
							<td>".$libelle."</td>
							<td><input type=\"hidden\" name=\"label".$valeur[0]."\" value=\"".$valeur[0]."\" /></td>
						  ";
						echo "<td>
								<span>
									<label for=\"choix".$valeur[0]."\"></label><input type=\"radio\" name=\"choix".$valeur[0]."\" value=\"oui\" onclick=\"$('#observation$valeur[0]').show()\" />
									</span>
									</td>";
						echo "<td><span><label for=\"choix".$valeur[0]."\"></label><input type=\"radio\" name=\"choix".$valeur[0]."\" value=\"non\" onclick=\"$('#observation$valeur[0]').hide()\"   /></span> </td>";
						echo "<td  style=\"display:none;\" id=\"observation".$valeur[0]."\"><span><label for=\"observation".$valeur[0]."\">Si Oui Pr&eacute;cisez :</label><textarea  style=\" width: 250px;height: 17px;\" rows=\"2\" cols=\"20\" name=\"observation".$valeur[0]."\"  ></textarea></span> </td>";
						echo "</tr>";
                     }
		  ?>
		</table>			
	
		</label>	  
		</fieldset>
			

			
						


<br /><br />

<div style="width: 430px; float: middle; height: 50px">
      <img id="siimage" align="left" style="padding-right: 5px; border: 0" src="securimage_show.php?sid=<?php echo md5(time()) ?>" />

        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="19" height="19" id="SecurImage_as3" align="middle">
			    <param name="allowScriptAccess" value="sameDomain" />
			    <param name="allowFullScreen" value="false" />
			    <param name="movie" value="securimage_play.swf?audio=securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5" />
			    <param name="quality" value="high" />
			
			    <param name="bgcolor" value="#ffffff" />
			    <embed src="securimage_play.swf?audio=securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5" quality="high" bgcolor="#ffffff" width="19" height="19" name="SecurImage_as3" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
			  </object>

        <br />
        
        <!-- pass a session id to the query string of the script to prevent ie caching -->
        <a tabindex="-1" style="border-style: none" href="#" title="Actualisez l'image" onclick="document.getElementById('siimage').src = 'securimage_show.php?sid=' + Math.random(); return false"><img src="images/refresh.gif" alt="Reload Image" border="0" onclick="this.blur()" align="bottom" /></a>
</div>
<div style="clear: both"></div>
Code:<br />

<!-- NOTE: the "name" attribute is "code" so that $img->check($_POST['code']) will check the submitted form field -->
<div align="left" class="required_info">
	<?
	if(isset($_GET['err']) && $_GET['err']==1){
	?>
	
	<p>
	
	<font color="#E8001F"><b>Tapez ce code convenablement SVP<b/></font><p>
	
	<?php
	}
	?> 
<input name="code" type="text" id="code" class="validate[required]" title="Veuillez entrer le code SVP!!"/>

</div>

<br /><br />









<!-- captcha -->

			<p><input class="submit" type="submit" value="ETAPE SUIVANTE" /></p>
<hr/>
</form>
		
	</body>
</html>